package com.xz.knowledgeDuplication.config;

import com.xz.knowledgeDuplication.util.FileUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 文件配置
 *
 * @author 召
 * @date 2022-01-02 17:51:09
 */
@Configuration
@ConfigurationProperties(prefix = "aliyun.oss")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FileConfig {

    private String endpoint;
    private String accessKeyId;
    private String accessSecret;
    private String bucketName;

    @Bean
    public FileUtil getFileUtil() {
        return new FileUtil(endpoint, accessKeyId, accessSecret, bucketName);
    }

}
